home *** CD-ROM | disk | FTP | other *** search
- Path: news.bridge.net!news
- From: David Byrden <100101.2547@compuserve.com>
- Newsgroups: comp.lang.c++
- Subject: STL experts, is this a bug?
- Date: 19 Jan 1996 10:56:09 GMT
- Organization: self-employed
- Message-ID: <4dntc9$6fo@news.bridge.net>
- NNTP-Posting-Host: ppp-mia1-50.bridge.net
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1N (Windows; I; 16bit)
-
-
-
- I'm trying to define an allocator and I have run into a problem.
-
- In the HP STL, deque::iterator has a default ctor which initialises
- several of its members with the value 0
-
- iterator() : current(0), first(0), last(0), node(0) {}
-
- These members have the type deque::pointer, which is a typedef
- for the pointer in deque's allocator.
-
- An allocator pointer, according to the standard, has exactly the same
- semantics as a random access iterator.
-
- I can find no place where it says that all random access iterators
- should be constructable from the int value zero, neither in
- documentation from the time of the HP STL, nor the latest draft standard.
-
- So, this ctor seems to break the rules. Yet it was written by the
- inventors of STL.
-
- Any contributions?
-
-
-
- David Byrden
-
-
-
-